package com.asialjim.wechat.apiservice;

import com.asialjim.wechat.pojo.accesstoken.AccessToken;

/**
 * <h1><em>ASIAL JIM JAVA DOC</em></h1><hr/>
 * <h2>INTERFACE DESCRIPTION <i>[ NAME: SecondAccessTokenCache ]</i></h2><strong>
 * <p> second access token cache
 * </strong><p><p><em>Copyright &copy; Asial Jim Co., LTD</em><hr/>
 *
 * @author Asial Jim &nbsp;&nbsp; <span>Email:<a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
 * @version 1.0.0
 * @since 2021/2/27   &nbsp;&nbsp; JDK 8
 */
public interface SecondAccessTokenCache {
    String BEAN_NAME = "secondAccessTokenCache";
    String CACHE_NAME = "WE-CHAT:ACCESS-TOKEN:SECOND-CACHE";

    /**
     * <h3>METHOD DESCRIPTION <i>[ NAME: accessToken ]</i></h3>
     * get access token from second class cache
     * @param appId {@link String appId}
     * @return {@link AccessToken access token}
     * @author Asial Jim &nbsp;&nbsp;<span>Email:asialjim@hotmail.com &nbsp;&nbsp; asialjim@qq.com</span>
     * @since 2021/2/2 17:49
     */
    AccessToken get(String appId);

    /**
     * <h3>METHOD DESCRIPTION <i>[ NAME: set ]</i></h3>
     * set access token
     * @param accessToken {@link AccessToken access token}
     * @author Asial Jim &nbsp;&nbsp;<span>Email:asialjim@hotmail.com &nbsp;&nbsp; asialjim@qq.com</span>
     * @since 2021/2/3 9:32
     */
    void set(AccessToken accessToken);

    /**
     * <h3>METHOD DESCRIPTION <i>[ NAME: removeAccessToken ]</i></h3>
     * remove access token from second class cache
     * @param appId {@link String appId}
     * @author Asial Jim &nbsp;&nbsp;<span>Email:asialjim@hotmail.com &nbsp;&nbsp; asialjim@qq.com</span>
     * @since 2021/2/2 17:51
     */
    void clean(String appId);

    void init();
}
